import React, { Component } from 'react'
import { View, Text } from 'react-native'
import { Header, Title, Button, Right, Body } from 'native-base'
import { Actions } from 'react-native-router-flux'
import Iconfont from '../iconfont'

export default class HeaderTransparent extends Component {
  settingsHandle () {
    Actions.settingsIndex()
  }
  render () {
    return (
      <View>
        <Header
          style={{
            backgroundColor: '#C30D23',
            borderWidth: 0
          }}
        >
          <Body
            style={{ flex: 4, justifyContent: 'center', alignItems: 'center' }}
          >
            <Title
              style={{
                color: '#fff'
              }}
            >
              赚元宝
            </Title>
          </Body>

          {((this.props.navigation.state.params &&
            this.props.navigation.state.params.settings) ||
            this.props.settings) && (
            <Right>
              <Button transparent onPress={this.settingsHandle}>
                <Text style={{ color: '#fff' }}>设置</Text>
                {/* <Iconfont name='shezhi' size={20} color='#eee' /> */}
              </Button>
            </Right>
          )}
        </Header>
      </View>
    )
  }
}
